package algorithm.easy;
public class TreeNode {
      int val;
      TreeNode left;
      TreeNode right;
      TreeNode() {}
      TreeNode(int val) { this.val = val; }
      TreeNode(int val, TreeNode left, TreeNode right) {
         this.val = val;
          this.left = left;
         this.right = right;
     }

     public static TreeNode init94(){
        TreeNode  root = new TreeNode(0);
         TreeNode  left = new TreeNode(1);
         TreeNode  left1 = new TreeNode(3);
         TreeNode  left2 = new TreeNode(4);
         TreeNode  right = new TreeNode(2);
         TreeNode  right1 = new TreeNode(5);
         TreeNode  right2 = new TreeNode(6);
         root.left = left;left.left = left1;left.right = left2;
         root.right = right;right.left = right1;right.right = right2;
         return root;
     }
    public static TreeNode init100(){
        TreeNode  root = new TreeNode(0);
        TreeNode  left = new TreeNode(2);
        TreeNode  left1 = new TreeNode(3);
        TreeNode  left2 = new TreeNode(4);
        TreeNode  right = new TreeNode(2);
        TreeNode  right1 = new TreeNode(5);
        TreeNode  right2 = new TreeNode(6);
        root.left = left;left.left = left1;left.right = left2;
        root.right = right;right.left = right1;right.right = right2;
        return root;
    }
    public static TreeNode init101(){
        TreeNode  root = new TreeNode(0);
        TreeNode  left = new TreeNode(1);
        TreeNode  left1 = new TreeNode(2);
        TreeNode  left2 = new TreeNode(3);
        TreeNode  right = new TreeNode(1);
        TreeNode  right1 = new TreeNode(3);
        TreeNode  right2 = new TreeNode(2);
        root.left = left;left.left = left1;left.right = left2;
        root.right = right;right.left = right1;right.right = right2;
        return root;
    }

    public static TreeNode init110(){
        TreeNode  root = new TreeNode(1);
        TreeNode  left = new TreeNode(2);
        TreeNode  left1 = new TreeNode(3);
        TreeNode  left2 = new TreeNode(3);
        TreeNode  left3 = new TreeNode(4);
        TreeNode  left4 = new TreeNode(9);
        TreeNode  right = new TreeNode(2);
        TreeNode  right1 = null;//new TreeNode();
        TreeNode  right2 = null;//new TreeNode();
        root.left = left;left.left = left1;left.right = left2;
        left1.left = left3;left1.right =left4;
        root.right = right;right.left = right1;right.right = right2;
        return root;
    }

    //[5,4,8,11,null,13,4,7,2,null,null,null,1]
    public static TreeNode init112(){
        TreeNode  node1 = new TreeNode(5);
        TreeNode  node2 = new TreeNode(4);
        TreeNode  node3 = new TreeNode(8);
        TreeNode  node4 = new TreeNode(11);
        TreeNode  node5 = null;
        TreeNode  node6 = new TreeNode(13);
        TreeNode  node7 = new TreeNode(4);
        TreeNode  node8 = new TreeNode(7);
        TreeNode  node9 =  new TreeNode(2);//new TreeNode();
        TreeNode  node10 = null;//new TreeNode();
        TreeNode  node11 = null;//new TreeNode();
        TreeNode  node12 = null;//new TreeNode();
        TreeNode  node13= new TreeNode(1);;//new TreeNode();
        node1.left = node2;
        node1.right = node3;
        node2.left=node4;
        node2.right = node5;
        node3.left = node6;
        node3.right = node7;
        node4.left = node8;
        node4.right = node9;
        node6.right = node13;
        return node1;
    }


 }